package com.authine.cloudpivot.common.extension.client.dto;

import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;
import java.util.Collections;
import java.util.List;

/**
 * 增量同步约定数据传输对象
 *
 * @author: zhangjie
 * @date: 2020/4/26 17:15
 */
@Setter
@ToString
public class OrgIncrementDTO<T> implements Serializable {

    private static final long serialVersionUID = 4141006125157102016L;

    /**
     * 增量同步时，新增和更新部门、用户、角色信息
     * DepartmentDTO  UserDTO  TagDTO
     */
    List<T> orgList;

    /**
     * 增量同步时，删除部门、用户、角色
     * deptId  userId  tagId
     */
    List<T> idList;

    public List<T> getOrgList() {
        if (orgList == null) {
            return Collections.emptyList();
        }
        return orgList;
    }

    public List<T> getIdList() {
        if (idList == null) {
            return Collections.emptyList();
        }
        return idList;
    }

}
